<template>
    <div class="student">    
        <h1>学生{{name}}{{address}}</h1>
        <button @click="studentClick">调用APP的studentClick1</button>
        <button @click="studentClick2">调用APP的studentClick2</button>
        <button @click="unbindClick">解绑</button>
    </div>
</template>

<script>
    export default {
        name:"MySchool",
        data(){
            return {
                name:'zzz1',
                address:"zzzzzzzzfffffff"
            }
        },
        methods:{
            studentClick(){
                // 向父组件调用v-on绑定的事件
                this.$emit("studentClick",this.name,6,6,6,6,6,6,6,)
            },
            studentClick2(){
                // 向父组件调用v-on绑定的事件
                this.$emit("studentClick2",this.name)
            },
            unbindClick(){
                // 解绑事件
                this.$off("studentClick")
                // 解绑多个事件
                this.$off(["studentClick","studentClick2"])
                // 解绑所有事件
                this.$off()
            }
        }
    }
</script>

<style scoped lang="less">
    .student{
        background-color: skyblue;
    }
</style>
